<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body,
        html {
            width: 100%;
            height: 100%;
        }

        body {
            box-sizing: content-box;
            overflow: hidden;
        }

        .clear:after {
            content: "";
            display: block;
            clear: both;
        }

        body {
            background-color: rgb(226, 226, 226);
        }

        #header .one {
            /* background-color:rgb(196, 190, 190) ; */
            border-radius: 8px;
            height: 37px;
            padding-top: 10px;
            font-size: 20px;
            padding-left: 10px;
            font-family: "微雅软墨";

        }

        #header .tow {
            background-color: white;
            line-height: 40px;
            font-size: 35px;
            position: relative;
            left: -7px;
        }

        .tow {
            word-spacing: 62px;
        }

        .tow a {
            text-decoration: none;
            color: black;

        }

        .four {
            font-size: 20px;
        }

        .five {
            word-spacing: 45px;
        }

        .six {
            word-spacing: 58px;
        }

        .Left {
            background-color: white;
            border: solid 1px;
            width: 50%;
            height: 418px;
            margin-top: 8px;
        }

        .Right {
            background-color: white;
            border: solid 1px;
            width: 50%;
            height: 414px;
            float: right;
            position: relative;
            left: 11px;
            top: -419px;
        }

        .seven {
            background-color: rgb(168, 168, 172);
            color: white;
            font-size: 17px;
            height: 31px;
            width: 100%;
            margin-top: 5px;
            line-height: 27px;
        }

        .eight {
            background-color: white;
            border: solid 1px;
            height: 229px;
            word-spacing: 48px;
        }

        .nine {
            position: relative;
            top: -20px;
        }

        /* 下拉按钮样式 */
        .dropbtn {
            background-color: rgb(255, 255, 255);
            color: black;
            padding: 16px;
            font-size: 16px;
            border: none;
            cursor: pointer;
        }

        /* 容器 <div> - 需要定位下拉内容 */
        .dropdown {
            position: relative;
            display: inline-block;
        }

        /* 下拉内容 (默认隐藏) */
        .dropdown-content {
            display: none;
            position: absolute;
            font-size: 15px;
            background-color: #f9f9f9;
            min-width: 160px;
            box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
        }

        /* 下拉菜单的链接 */
        .dropdown-content a {
            color: black;
            padding: 12px 16px;
            text-decoration: none;
            display: block;
        }

        /* 鼠标移上去后修改下拉菜单链接颜色 */
        .dropdown-content a:hover {
            background-color: #f1f1f1
        }

        /* 在鼠标移上去后显示下拉菜单 */
        .dropdown:hover .dropdown-content {
            display: block;
        }

        /* 当下拉内容显示后修改下拉按钮的背景颜色 */
        .dropdown:hover .dropbtn {
            background-color: rgb(228, 226, 226);
        }

        .DF {
            border: 1px #f1f1f1;
        }

        .refresh {
            border: 1px white;
            position: relative;
            left: 12px;
            top: 10px;
            font-size: 23px;
            background-color: white;
        }
    </style>
</head>

<body>
    <!--顶部-->
    <header id="header" class="clear">
        <div class="one">
            <span>数警法鉴</span>
        </div>
        <div class="tow">
            <div class="dropdown">
                <button class="dropbtn">驱动器(D)</button>
                <div class="dropdown-content">
                    <input class="refresh" type="button" onclick="javascript:location.reload();" value="刷新">
                    <a href="#">刷新的选择</a>
                    <a href="#">打开驱动界面</a>
                    <a href="#">恢复所有文件</a>
                    <a href="#">扫描</a>
                    <a href="#">退出</a>
                </div>
            </div>
            <div class="dropdown">
                <button class="dropbtn">创建(C)</button>
                <div class="dropdown-content">
                    <a href="#">创建区域</a>
                    <a href="#">创建专用区域</a>
                    <a href="#">创建虚拟卷集</a>
                    <a href="#"></a>
                    <a href="#"></a>
                </div>
            </div>
            <div class="dropdown">
                <button class="dropbtn">工具(T)</button>
                <div class="dropdown-content">
                    <a href="#">停止</a>
                    <a href="#">编辑</a>
                    <a href="#">删除</a>
                    <a href="#">查看编辑</a>
                    <a href="#">关闭所有预览</a>
                </div>
            </div>
            <div class="dropdown">
                <button class="dropbtn">查看(V)</button>
                <div class="dropdown-content">
                    <a href="#">工具栏</a>
                    <a href="#">工具栏按钮文本</a>
                    <a href="#">状态栏</a>
                    <a href="#">属性视图</a>
                    <a href="#">事件日志</a>
                    <a href="#">收索结果</a>
                </div>
            </div>
            <div class="dropdown">
                <button class="dropbtn">帮助(H)</button>
                <div class="dropdown-content">
                    <a href="#">搜索</a>
                    <a href="#">索引</a>
                    <a href="#">内容</a>
                    <a href="#">检查更新</a>
                    <a href="#">界面语言</a>
                </div>
            </div>
        </div>
        <!-- <div class="wenzi">
            <tr>
               <td><a href="#">刷新</a></td> 
                <td><a href="#">显示文件</a></td>
                <td><a href="#">扫描</a></td>
                <td><a href="#">分区搜索</a></td>
                <td><a href="#">创建镜像</a></td>
                <td><a href="#">打开镜像</a></td>
                <td><a href="#">创建区域</a></td>
                <td><a href="#">Start Runtime Image</a></td>
                <td><a href="#">RAID</a></td>
                <td><a href="#">连接到远程</a></td>
                <td><a href="#">删除</a></td>
                <td><a href="#">停止</a></td>
            </tr>
            </div> -->
    </header>
    <!--主体-->
    <article id="container">
        <div class="four">
            <span>设备视图</span>
        </div>
        <section class="Left">
            <div class="five">
                <tr class="fiveone">
                    <td>设备/磁盘</td>
                    <td>标签</td>
                    <td>FS/界面</td>
                    <td>启动</td>
                    <td>大小</td>
                </tr>

            </div>
        </section>
        <aside class="Right">
            <div class="six">
                <tr>
                    <td>名称</td>
                    <td>值</td>
                </tr>
            </div>
        </aside>
    </article>
    <!--底部-->
    <footer id="footer">
        <div class="seven" onclick="f1(this)">
            <span>日志</span>
        </div>
        <div class="eight">
            <tr>
                <td>文本</td>
                <td>类型</td>
                <td>日期</td>
                <td>时间</td>
            </tr>

        </div>
        </div>
    </footer>
</body>
<script>
    function showPopup() {
        var overlay = document.getElementById("overlay");
        overlay.style.display = "block";
    }
    function hidePopup() {
        var overlay = document.getElementById("overlay");
        overlay.style.display = "none";
    }
    function importFile() {
        var inputObj = document.createElement('input')
        inputObj.setAttribute('id', '_ef');
        inputObj.setAttribute('type', 'file');
        inputObj.setAttribute("style", 'visibility:hidden');
        document.body.appendChild(inputObj);
        inputObj.click();
        inputObj.value;
    }

    function f1(e) {
        e.style.backgroundColor = 'blue'
    }

    // TODO 周陈佳
    const base_dir = "http://127.0.0.1:8000/"
    const xhr = new XMLHttpRequest()
    const left = document.querySelector(".five")

    xhr.open("get", base_dir + "disk")
    xhr.send()
    xhr.responseType = 'json'
    xhr.onload = function () {
        if (xhr.status >= 200 && xhr.status < 300) {
            // 请求成功，处理返回的 JSON 数据
            const data = xhr.response

            for (let i of data) {
                const tr = document.createElement("tr");
                tr.innerText = i;
                left.append(tr)
            }

        }
    }
</script>

</html>